﻿@namespace Masa.Docs.Shared.Shared
@inherits NextTickComponentBase

<MNavigationDrawer Id="default-toc"
                   Right
                   Color=""
                   App
                   Class="py-6 pr-4"
                   Clipped
                   Floating
                   Width="300">
    <PrependContent>
        <ErrorBoundary>
            <ChildContent>
                <GitHubIssues />
            </ChildContent>
            <ErrorContent>
            </ErrorContent>
        </ErrorBoundary>
    </PrependContent>

    <ChildContent>
        @if (_toc.Any())
        {
            <div class="toc-content mb-2 ml-6">@I18n.T("Contents")</div>
        }
        <ul class="mb-6">
            @foreach (var item in _toc)
            {
                <li class="pl-3 text-body-2 py-1 font-weight-regular @GenClass(item) toc-li">
                    <a href="@($"#{item.Anchor}")"
                       class="m-toc-link d-block transition-swing text-decoration-none"
                       @onclick:preventDefault
                       @onclick="@(() => ScrollIntoView(item.Anchor))">
                        @item.Content
                    </a>
                </li>
            }
        </ul>
        <Sponsors />
        <Contact />
    </ChildContent>
</MNavigationDrawer>
